package com.github.lee.unsplash.model.api

import com.github.lee.unsplash.domain.AuthBean
import com.github.lee.unsplash.domain.response.BaseResult
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface AuthApi {

    @POST("oauth/token")
    @FormUrlEncoded
    suspend fun oauth(
        @Field("client_id") clientId: String,
        @Field("client_secret") clientSecret: String,
        @Field("code") code: String,
        @Field("redirect_uri") redirectUri: String? = "urn:ietf:wg:oauth:2.0:oob",
        @Field("grant_type") grantType: String? = "authorization_code"
    ): BaseResult<AuthBean>

}